home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / tree / DefaultMutableTreeNode$BreadthFirstEnumeration$Queue.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.6 KB  |  54 lines

  1. package javax.swing.tree;
  2.  
  3. import java.util.NoSuchElementException;
  4.  
  5. final class DefaultMutableTreeNode$BreadthFirstEnumeration$Queue {
  6.    // $FF: synthetic field
  7.    private final DefaultMutableTreeNode.BreadthFirstEnumeration this$1;
  8.    DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode head;
  9.    DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode tail;
  10.  
  11.    DefaultMutableTreeNode$BreadthFirstEnumeration$Queue(DefaultMutableTreeNode.BreadthFirstEnumeration var1) {
  12.       this.this$1 = var1;
  13.    }
  14.  
  15.    public Object dequeue() {
  16.       if (this.head == null) {
  17.          throw new NoSuchElementException("No more elements");
  18.       } else {
  19.          Object var1 = this.head.object;
  20.          DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode var2 = this.head;
  21.          this.head = this.head.next;
  22.          if (this.head == null) {
  23.             this.tail = null;
  24.          } else {
  25.             var2.next = null;
  26.          }
  27.  
  28.          return var1;
  29.       }
  30.    }
  31.  
  32.    public void enqueue(Object var1) {
  33.       if (this.head == null) {
  34.          this.head = this.tail = new DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode(this, var1, (DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode)null);
  35.       } else {
  36.          this.tail.next = new DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode(this, var1, (DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode)null);
  37.          this.tail = this.tail.next;
  38.       }
  39.  
  40.    }
  41.  
  42.    public Object firstObject() {
  43.       if (this.head == null) {
  44.          throw new NoSuchElementException("No more elements");
  45.       } else {
  46.          return this.head.object;
  47.       }
  48.    }
  49.  
  50.    public boolean isEmpty() {
  51.       return this.head == null;
  52.    }
  53. }
  54.